{% if posts %}
    {% for post in posts %}
        <h3 class="text-primary">
            <a href="{{ url_for('blog.show_post', post_id=post.id) }}">{{ post.title }}</a>
        </h3>
        <p>
            {{ post.body | striptags | truncate }}
            <small><a href="{{ url_for('blog.show_post', post_id=post.id) }}">Read More</a></small>
        </p>
        <small>
            Comments:
            <a class="bold_text" href="{{ url_for('blog.show_post', post_id=post.id) }}#comments">
                {{ post.comments | length }}
            </a>&nbsp;&nbsp;
            Category:
            <a class="bold_text" href="{{ url_for('blog.show_category', category_id=post.category.id) }}">
                {{ post.category.name }}
            </a>
            <span style="float:right;margin-right: 12px;">{{ moment(post.timestamp).format('LL') }}</span>
        </small>
        {% if not loop.last %}
            <hr>
        {% endif %}
    {% endfor %}
{% else %}
    <div class="card">
        <div class="card-body tip"><h5>No Posts.</h5></div>
    </div>
{% endif %}